Holds all informations related to GPU programs, and manages their compilation. More...
Holds all informations related to GPU programs, and manages their compilation.
nkGraphics::Program::Program | ( | ) |
Constructor. See ShaderManager::createOrRetrieveProgram().
|
virtual |
Destructor.
const ProgramCompilationResult& nkGraphics::Program::getLastCompilationResult | ( | ) | const |
bool nkGraphics::Program::isFromFile | ( | ) | const |
bool nkGraphics::Program::isFromMemory | ( | ) | const |
ProgramSourcesHolder* nkGraphics::Program::getMemory | ( | ) | const |
const InfiniteByteMask& nkGraphics::Program::getSemantics | ( | ) | const |
unsigned int nkGraphics::Program::getId | ( | ) | const |
PROGRAM_TYPE nkGraphics::Program::getType | ( | ) | const |
PROGRAM_COMPILATION_PROFILE nkGraphics::Program::getProfile | ( | ) | const |
|
virtual |
Sets the program from an already loaded memory set.
The memory used will need to fit some constraints for a Program to find back relevant data :
memory | The memory to use. |
|
virtual |
Sets the defines to use within the program. Can be useful to add defines and then load a program from a folder.
memory | The memory to copy de defines from. |
void nkGraphics::Program::setFromFiles | ( | const nkMemory::StringView & | folder | ) |
Sets the folder from which the program should load its sources. The files that can be loaded are :
folder | The path of the folder to load from, relative to the working directory. See nkResources::ResourceManager for the path naming conventions. |
void nkGraphics::Program::setId | ( | unsigned int | id | ) |
Sets the id of the program.
id | The id to use. |
void nkGraphics::Program::setProfile | ( | PROGRAM_COMPILATION_PROFILE | profile | ) |
Sets the profile to use for compilation.
profile | The profile to use. |
bool nkGraphics::Program::prepareMemoryWithFiles | ( | ) |
If the program is defined from a folder, prepares the memory with the source files content.
|
pure virtual |
Loads the program, from the memory currently set.
|
pure virtual |
Tries to load from a provided memory, and swap the current state with the newly submitted state only on success. If it fails, the program state is not changed.
newMemory | The memory to try to load from. |
|
overridevirtual |
Loads and compiles the program.
Implements nkGraphics::Resource.
|
overridevirtual |
Unloads and frees the internal resources of the program.
Implements nkGraphics::Resource.
|
overridevirtual |
Basic exporting capabilities.
rootNode | The tree to export to. |
Implements nkExport::Exportable.
|
overridevirtual |
Basic importing capabilities.
rootNode | The tree to import from. |
Implements nkExport::Exportable.